/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package multiface.promonet.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import multiface.promonet.jpa.util.PersistenceManager;

/**
 * Web application lifecycle listener.
 *
 * @author Diego64
 */
@WebListener()
public class PersistanceListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        PersistenceManager.getInstance().closeEntityManagerFactory();
    }
}
